#include<bits/stdc++.h>
using namespace std;
#define int long long

string s[505];
string s1 = "COFFEE", s2 = "CHICKEN";

signed main() {
	s[1] = "k";
	s[2] = "j";
	for (int i = 3; i <= 100; i++){
		s[i] = s[i - 2] + s[i - 1];
		cout << i << " " << s[i] << endl;
		system("pause");
	}
		

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int sum = 0;
		for (int i = 0; i < s[n].size(); i++) {
			if (s[n][i] == 'k') {
				if (sum + 6 < k)
					sum += 6;
				else {
					cout << s1.substr(k - sum);
					if (s[n][i + 1] == 'k')
						cout << s1.substr(0, 10 - k + sum);
					else
						cout << s2.substr(0, 10 - k + sum);
					cout << endl;
					break;
				}
			} else {
				if (sum + 7 < k)
					sum += 7;
				else {
					cout << s1.substr(k - sum);
					if (s[n][i + 1] == 'k')
						cout << s1.substr(0, 10 - k + sum);
					else
						cout << s2.substr(0, 10 - k + sum);
					cout << endl;
					break;
				}
			}
		}
	}
	return 0;
}
